package GDD;

public class GSite {
	//attribution
	public short siteType;
	public String IP;
	public int port;
	public String siteName;
	public int fragmentNum;
	public String []fragments;
	//method
	GSite(String name, String tip, int tport, short type){
		siteName = name;
		IP = tip;
		port = tport;
		siteType = type;
		if(siteName.compareTo("Site1")==0){
			fragmentNum = 4;
			fragments = new String[fragmentNum];
			fragments[0] = new String("Publisher.1");
			fragments[1] = new String("Book.1");
			fragments[2] = new String("Customer.1");
			fragments[3] = new String("Orders.1");
		}
		else if(siteName.compareTo("Site2")==0){
			fragmentNum = 4;
			fragments = new String[fragmentNum];
			fragments[0] = new String("Publisher.2");
			fragments[1] = new String("Book.2");
			fragments[2] = new String("Customer.2");
			fragments[3] = new String("Orders.2");
		}
		else if(siteName.compareTo("Site3")==0){
			fragmentNum = 3;
			fragments = new String[fragmentNum];
			fragments[0] = new String("Publisher.3");
			fragments[1] = new String("Book.3");
			fragments[2] = new String("Orders.3");
		}
		else if(siteName.compareTo("Site4")==0){
			fragmentNum = 2;
			fragments = new String[fragmentNum];
			fragments[0] = new String("Publisher.4");
			fragments[1] = new String("Orders.4");
		}
	}
}
